package cc.facesign.acl.controller;

import cc.facesign.common.utils.bean.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/acl/utils")
@Api(description = "工具")
public class UtilsController {

    @Autowired
    private PasswordEncoder passwordEncoder;

    @ApiOperation("生成秘钥")
    @GetMapping("/getPassword")
    public R getPassword(String s) {
        String encode = passwordEncoder.encode(s);
        return R.ok().data("encode", encode);
    }
}
